feat: change public schema to trueforge schema for Postgres - #488
Conversation
🦋 Changeset detectedLatest commit: 43bf3cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
chiragjn
left a comment
There was a problem hiding this comment.
Keeping this approved. See if we really need the test
it('moves legacy public tables into trueforge and preserves migration history'
to run in C/I everytime
…ng and schema existence check
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3263417. Configure here.
… transaction handling and removing legacy locking logic

Summary
change public schema to trueforge schema for Postgres
Changes
change public schema to trueforge schema for Postgres
How was this tested?
Recreating every scenarios and also through tests
Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Medium Risk
One-time DDL that relocates live tables from
publiccan fail or contend on locks in shared Postgres instances; bootstrap is guarded but upgrades should be validated on representative data.Overview
Moves Trueforge’s Postgres footprint out of
publicinto a dedicatedtrueforgeschema so app data and Kysely’s migration tables are namespaced separately from other database users.ensureTrueforgeSchemaruns before migrations: on first use it creates the schema (with advisory lock +lock_timeout), thenALTER TABLE … SET SCHEMAfor Kysely bookkeeping and all listed app tables still inpublic. Fresh installs and already-migrated DBs short-circuit when the namespace exists. The migrator now records history inmigrationTableSchema: trueforge, andcreateDbsetssearch_path=trueforgeon every pooled connection so unqualified queries hit the right tables.AGENTS guidance and the Postgres client integration test are updated to assert
search_pathalongside existing timeout settings.Reviewed by Cursor Bugbot for commit 43bf3cf. Bugbot is set up for automated code reviews on this repo. Configure here.